<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Anuncios</title>
</head>
<body>
<f:view>
  <h1> Classificados Online</h1>
  <h:dataTable border="1" value="#{principal.anuncios}" var="anuncio">
  <h:column id="anuncio">
    <f:facet name="header">
					<h:outputText value="Anúncio"></h:outputText>
				</f:facet>
    <h:outputText value="#{anuncio.resumo}"></h:outputText> 
    </h:column>
    <h:column id="numcomentarios">
    <f:facet name="header">
					<h:outputText value="Números Comentários"></h:outputText>
				</f:facet>
    <h:outputText value="#{anuncio.quantidadeComentarios}"></h:outputText> 
    </h:column>
  </h:dataTable>
  
  
  
  
  <h2> Anuncie aqui!</h2>
  
  Informe login e senha para entrar no sistema.
	
		<h:form>
			<h:panelGrid border="1" columns="2">
				<h:outputText value="Login: "></h:outputText>
				<h:inputText value="#{principal.login}"></h:inputText>
				<h:outputText value="Senha: "></h:outputText>
				<h:inputSecret value="#{principal.senha}"></h:inputSecret>
			</h:panelGrid>
			<h:commandButton value="Efetur Login" action="#{principal.autentica}"></h:commandButton>
		</h:form>
		<h:form>
			<h:commandLink action="cadastro">
				<h:outputText value="Não tem login? Efetue o seu cadastro aqui!"></h:outputText>
				<f:setPropertyActionListener value="" target="#{principal.msg}"/>
			</h:commandLink></br>
			<h:commandLink action="anuncios">
				<h:outputText value="Clique aqui para visualizar nosssos anúncios"></h:outputText>
			</h:commandLink>
		</h:form>
  
</f:view>
</body>
</html>